-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CK Tile Gemm API and heuristics changes #1809
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good start!
using BDataType = ck_tile::half_t; | ||
using AccDataType = float; | ||
using CDataType = ck_tile::half_t; | ||
// ToDo: Add more bias config to support different categories of GEMM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add your nick name to todo?
float gemm_(const ck_tile::GemmHostArgs& args, const ck_tile::stream_config& s); | ||
|
||
/** | ||
* \brief Invoke gemm function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please use @
syntax instead of \
. Please have a look at tile_partitioner
file
@@ -0,0 +1,124 @@ | |||
|
|||
// SPDX-License-Identifier: MIT | |||
// Copyright (c) 2024-2025, Advanced Micro Devices, Inc. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only 2025?
@@ -101,6 +100,30 @@ float gemm_calc(const ck_tile::GemmHostArgs& args, const ck_tile::stream_config& | |||
return ave_time; | |||
} | |||
|
|||
float gemm(const gemm_traits& t, const ck_tile::GemmHostArgs& args, const ck_tile::stream_config& s) | |||
{ | |||
if(t.is_a_rowmajor && t.is_b_rowmajor && t.is_c_rowmajor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[[Consider]] Please have a look that we repeatedly use mechanisms to check whether we have a specific layout... t.is_a_rowmajor && t.is_b_rowmajor && t.is_c_rowmajor
etc.
Maybe it would be worth considering has_enabled_RRR
mechanis *(1), either at the traits structure level or as a separate mechanism? This way, we could avoid duplicating these checks, reduce the possibility of mistakes etc.
*(1) Example:
t.has_enabled_RRR()
Proposed changes
Add api for CK TILE Gemm similar to FMHA's one and add instances
Checklist
Please put an
x
into the boxes that apply. You can also fill these out after creating the PR. If you're not sure, please don't hesitate to ask.clang-format
on all changed filesDiscussion
Add api for CK Tile universal gemm and some instances for fp16 and bf16 cases. I'm not sure how the heuristic of choosing between comp and mem instances should be made so for now it is trivial and will be upgraded in the near future